import request from '@/utils/request'

export function queryByPage (data) {
  return request({
    url: '/sysRole/queryByPage',
    method: 'post',
    data: data
  })
}

export function insert (data) {
  return request({
    url: '/sysRole/insert',
    method: 'post',
    data: data
  })
}

export function update (data) {
  return request({
    url: '/sysRole/update',
    method: 'post',
    data: data
  })
}

export function deleteById (params) {
  return request({
    url: '/sysRole/deleteById',
    method: 'get',
    params
  })
}

export function roleInsert (data) {
  return request({
    url: 'sysUserRole/batchInsert',
    method: 'post',
    data: data
  })
}

export function batchInsert (data) {
  return request({
    url: '/sysPermission/batchInsert',
    method: 'post',
    data: data
  })
}

export function queryTree (data) {
  return request({
    url: '/sysPermission/queryByPage',
    method: 'post',
    data: data
  })
}

export function getRole (data) {
  return request({
    url: '/sysRole/queryList',
    method: 'post',
    data: data
  })
}